﻿<!DOCTYPE html>
<html>
<head>
    <title>诚创网络综合服务平台</title>
    <script src="__PUBLIC__/Home/js/jquery-1.11.1.min.js"></script>
    <script src="__PUBLIC__/Home/js/layer/layer.js"></script>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta http-equiv="pragram" content="no-cache">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>后台登录</title>
    <style>
        .homeAdminContent{position: absolute;left:0;right: 0;bottom: 0;top:0;min-width: 1100px;min-height: 600px;}
        .footCopyright{position: absolute;left:0;right: 0;bottom: 0;line-height:35px;color:#fff;color:rgba(255,255,255,0.7);background-color:#333;background-color:rgba(0,0,0,0.5);font-size:12px;text-align: center;}
        .homeAdmin{position: absolute;left:0;right: 0;top: 0;bottom:0;background-size: cover;background-position: center;background-repeat: no-repeat;background-image: url(__PUBLIC__/Home/images/homeAdminBg.jpg);min-width: 1100px;text-align: center;}
        .homeAdmin>span{display: inline-block;height: 100%;vertical-align: middle;}
        .adminLoginForm{display: inline-block;vertical-align: middle;color:#fff;background-color: #fff;background-color: rgba(0,0,0,0.4);width:500px;padding:30px 0 40px 0;border-radius: 10px;}
        .adminlogoHead{width:220px;margin-bottom:17px;}
        .adminForm{display:block;width:330px;margin:0 auto;margin-bottom:22px;border-radius: 5px;border:1px solid #fff;height: 45px;}
        input.adminForm{color:#fff;background-color:#e7cd02;border: none;font-size:16px;font-weight: bold;outline: none;margin-top:50px; }
        input.adminForm:hover{background-color: #CDBC38;color:#333;}
        .adminForm img{float:left;width:28px;margin-top:7px;margin-left:8px;}
        .adminForm input{float:right;height:28px;width:283px;margin-top:7px;background-color: transparent;color:#fff;border: none;outline: none;text-indent: 10px;border-left: 1px solid #fff;font-size:15px;}
        .adminForm select{float:right;height:28px;color:#a9a9a9;width:283px;margin-top:7px;background-color: transparent;border: none;outline: none;text-indent: 10px;border-left: 1px solid #fff;font-size:15px;}
    </style>
</head>
<body>
<div class="homeAdminContent">
    <div class="homeAdmin">
        <span></span>
        <div class="adminLoginForm">
                <label class="adminForm">
                    <img src="__PUBLIC__/Home/images/phone-white.png"/>
                    <input type="text" class="form-control"  name="name" placeholder="登陆用户名">
                </label>
                <label class="adminForm">
                    <img src="__PUBLIC__/Home/images/adminsuo.png"/>
                    <input type="password" class="form-control"  name="pass"  placeholder="登陆密码">
                </label>
                <label class="adminForm" style="position: relative">
                    <img src="__PUBLIC__/Home/images/code.png"/>
                    <input type="text"  class="form-control"  name="code"  placeholder="验证码">
                    <img id="code" style="border-radius: 5px;position:absolute;top:-7px;right:0px;z-index: 100;width:90px;height:45px" src="<{:U('Code/index')}>"  alt="验证码" onclick="$(this).attr('src','<{:U('Code/index')}>?rand='+Math.random())" >
                </label>
                <input style="cursor: pointer" type="submit" class="adminForm" id="save" value="登  录"  href='javascript:;'  >
        </div>
    </div>
</div>
</body>
<script>
    document.onkeydown = function(e){
        var ev = document.all ? window.event : e;
        if(ev.keyCode==13) {
            $("#save").click();
        }
    }
    $("#save").click(function(){
        if($("input[name='name']").val() == ''){
            layer.tips('请输入用户名！', 'input[name="name"]', {tips: [2, 'red'], time: 1000});
            return;
        }
        if($("input[name='pass']").val() == ''){
            layer.tips('请输入密码！', 'input[name="pass"]', {tips: [2, 'red'], time: 1000});
            return;
        }
        if($("input[name='code']").val() == ''){
            layer.tips('请输入验证码！', 'input[name="code"]', {tips: [2, 'red'], time: 1000});
            return;
        }
        $.post(
                "<{:U('Login/login')}>",
                {
                   name:$("input[name='name']").val(),
                   pass:$("input[name='pass']").val(),
                   code:$("input[name='code']").val()
                },
                function(res){
                    if(res.status == 1){
                        location.href = "<{:U('Index/index')}>";
                    }else{
                        layer.tips(res.info, '#save', {tips: [2, 'red'], time: 1000});
                        $("#code").click();
                    }
            }
        );
    });
</script>
</html>